Argos DataBlock Connector - Generic Sample Script

The sample script Evisions provides is intended to be used as a starting point for your own script development. It demonstrates a basic API call to the DataBlock Connector, and shows the JSON data being returned. You will need to modify the script as needed to work with any 3rd-party applications you wish to use with Argos data.

Install Script Files

If not already installed, refer to the previous section for instructions on obtaining the script files and placing them on the MAPS server.

The sample script is comprised of three files:

By default, these files are installed in the ..\http_files\adbc\Sample folder of the MAPS Service directory. If you intend to customize the script or write a new one, we recommend placing your modified files in ..\http_files\adbc\Sample\Custom to ensure that your changes are not overwritten accidentally in the future. Files in a Custom folder will automatically be used in place of files of the same name one directory up.

Connecting to a DataBlock in the Simulator

To load the simulator, open a browser and navigate to the URL of your MAPS server, followed by the path to the adbc.html file from the http_files directory of the MAPS Service folder. For example, http://myserver/adbc/Sample/adbc.html

The page provides input fields where you can specify your server locations, a set of credentials, and a path to the DataBlock you want to run.

Sample script html page showing fields where you enter the server address, username, password, and path to the DataBlock you want to run.

In the MAPS Server field, enter the URL or IP address of your MAPS server. Then, enter the username and password for a user who has appropriate permissions to access Argos, the DataBlock you wish to run, and any necessary data connections.

Note that there is no sign in button. The credentials you enter here are passed over in the API call when reading in the input fields or data.

In the DataBlock Path field, enter the path to the DataBlock that you want to access. The path uses the Argos path format where folders are separated by a period. In the example above, the DataBlock called "Name Distribution" is located in a folder called "My Folder". In the Argos client, you can find the path of any object by right-clicking on it and selecting Copy Path to Clipboard.

The next step is to select Read Inputs to retrieve a list of the parameters expected by this DataBlock's report query. The JSON structure for the required inputs will appear in an edit box to the right.

Next to the Read Inputs button, a memo field contains the JSON data read in for the parameters for the specified DataBlock (see example text below).

The JSON format includes a name, data type, and value for each parameter. The name and data type are provided for you when reading in the parameters. All values are set to "null" by default.

To edit the values or add additional values, you will need to edit the values in the JSON. For example, instead of "null" as the value for Dropdown1.Count, we have replaced this with "20" in the example below. Similarly, for the last name, we have replaced the "null" value with an array containing three names.

 

[ { "name": "DropDown1.Count", "dataType": "String", "value": "20" }, { "name": "Last_Name_Filter", "dataType": "String", "value": ["Ziegler","Morrison","Reyes"] }, { "name": "Start_Date", "dataType": "Date", "value": "2017-03-16" } ]

Wildcard Characters

If the SQL in the report query supports it,(i.e., you know that the query is using the parameter in a LIKE statement), you can use a percent sign (%) as a wildcard character. For example, entering "Ab%" for a name field could return names such as "Abby", "Aberforth", etc.

When you are finished entering the parameters, select Read Data to get the results of the report query. Again, the results are returned in JSON format.

After selecting Read Data, the memo box to the right is populated with the column and row data, as described below.

The columns (fields) being returned are listed first, followed by the rows:

			

Columns: [ { "name": "upper(substr(spriden_last_name,1,1))", "alias": "firstinitial", "description": "", "dataType": "String" }, { "name": "count(spriden_pidm)", "alias": "count", "description": "", "dataType": "Float" } ] Rows: [ ["A",12], ["G",6], ["J",11] ]